﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_GetUser_BasicReferences')
	BEGIN
		DROP  Procedure  esf_sso.P_GetUser_BasicReferences
	END

GO

CREATE Procedure esf_sso.P_GetUser_BasicReferences
	@pUserPersonID	INT
	,@pBasicReferenceTypeID	INT
AS

	SELECT
		VBR.*
	FROM
		esf_sso.User_BasicReference UB
	INNER JOIN
		esf_sso.VBasicReference VBR ON VBR.ID = UB.BasicReferenceID
	WHERE
		UB.UserPersonID = @pUserPersonID
		AND VBR.BasicReferenceTypeID = @pBasicReferenceTypeID 

GO